<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title></title>
    <link href="css/base.css" type="text/css" rel="stylesheet" />
    <script src="js/rem.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.min.js"></script>
</head>
<body>
<div id="app">
    <h3>Web模块</h3>

    <h3 id="showmsg">调用js显示结果</h3>

    <input type="button" value="Js调用Java代码" onclick="window.android.launcher()"/>

    <input type="button" value="Js调用Java代码并传参数" id="button2" v-if="nfc=='true'" @click="gocard"/>
</div>

</body>
<script>
window.isNFC = function(nfc){

  sessionStorage.setItem('isNfc',nfc)
    //alert(nfc)
}
new Vue({
    el:'#app',
    data(){
        return {
            nfc:''
        }
    },
    mounted(){
        setTimeout(()=>{
            this.nfc=sessionStorage.getItem('isNfc')
            //alert(sessionStorage.getItem('isNfc'))
        },1000)
    },
    methods:{
        gocard(){
            console.log(this.$route)
            var test=window.android.goWriteCard(JSON.stringify({
                      cardId: this.$route.query.cardNo
                }
            ))
            eval(test)
        }
    }
})
</script>
</html>
